home *** CD-ROM | disk | FTP | other *** search
/ C++ für Kids / C++ for kids.iso / SETUP / US / CBUILDER / DATA.Z / MAPIUTIL.H < prev    next >
C/C++ Source or Header  |  1997-02-13  |  31KB  |  901 lines

  1. /*
  2.  *  M A P I U T I L . H
  3.  *
  4.  *  Definitions and prototypes for utility functions provided by MAPI
  5.  *  in MAPI[xx].DLL.
  6.  *
  7.  *  Copyright 1986-1996 Microsoft Corporation. All Rights Reserved.
  8.  */
  9.  
  10. #ifndef _MAPIUTIL_H_
  11. #define _MAPIUTIL_H_
  12. #pragma option -b
  13.  
  14. #ifdef __BORLANDC__
  15. #pragma option -b.
  16.   #include <pshpack8.h>
  17. #pragma option -b
  18. #endif
  19.  
  20. #if defined (WIN32) && !defined (_WIN32)
  21. #define _WIN32
  22. #endif
  23.  
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27.  
  28. #ifndef MAPIX_H
  29. #pragma option -b.
  30. #include <mapix.h>
  31. #pragma option -b
  32. #endif
  33.  
  34. #ifdef WIN16
  35. #pragma option -b.
  36. #include <storage.h>
  37. #pragma option -b
  38. #endif
  39.  
  40. #ifndef BEGIN_INTERFACE
  41. #define BEGIN_INTERFACE
  42. #endif
  43.  
  44.  
  45. /* IMAPITable in memory */
  46.  
  47. /* ITableData Interface ---------------------------------------------------- */
  48.  
  49. DECLARE_MAPI_INTERFACE_PTR(ITableData, LPTABLEDATA);
  50.  
  51. typedef void (STDAPICALLTYPE CALLERRELEASE)(
  52.     ULONG       ulCallerData,
  53.     LPTABLEDATA lpTblData,
  54.     LPMAPITABLE lpVue
  55. );
  56.  
  57. #define MAPI_ITABLEDATA_METHODS(IPURE)                                  \
  58.     MAPIMETHOD(HrGetView)                                               \
  59.         (THIS_  LPSSortOrderSet             lpSSortOrderSet,            \
  60.                 CALLERRELEASE FAR *         lpfCallerRelease,           \
  61.                 ULONG                       ulCallerData,               \
  62.                 LPMAPITABLE FAR *           lppMAPITable) IPURE;        \
  63.     MAPIMETHOD(HrModifyRow)                                             \
  64.         (THIS_  LPSRow) IPURE;                                          \
  65.     MAPIMETHOD(HrDeleteRow)                                             \
  66.         (THIS_  LPSPropValue                lpSPropValue) IPURE;        \
  67.     MAPIMETHOD(HrQueryRow)                                              \
  68.         (THIS_  LPSPropValue                lpsPropValue,               \
  69.                 LPSRow FAR *                lppSRow,                    \
  70.                 ULONG FAR *                 lpuliRow) IPURE;            \
  71.     MAPIMETHOD(HrEnumRow)                                               \
  72.         (THIS_  ULONG                       ulRowNumber,                \
  73.                 LPSRow FAR *                lppSRow) IPURE;             \
  74.     MAPIMETHOD(HrNotify)                                                \
  75.         (THIS_  ULONG                       ulFlags,                    \
  76.                 ULONG                       cValues,                    \
  77.                 LPSPropValue                lpSPropValue) IPURE;        \
  78.     MAPIMETHOD(HrInsertRow)                                             \
  79.         (THIS_  ULONG                       uliRow,                     \
  80.                 LPSRow                      lpSRow) IPURE;              \
  81.     MAPIMETHOD(HrModifyRows)                                            \
  82.         (THIS_  ULONG                       ulFlags,                    \
  83.                 LPSRowSet                   lpSRowSet) IPURE;           \
  84.     MAPIMETHOD(HrDeleteRows)                                            \
  85.         (THIS_  ULONG                       ulFlags,                    \
  86.                 LPSRowSet                   lprowsetToDelete,           \
  87.                 ULONG FAR *                 cRowsDeleted) IPURE;        \
  88.  
  89. #undef       INTERFACE
  90. #define      INTERFACE  ITableData
  91. DECLARE_MAPI_INTERFACE_(ITableData, IUnknown)
  92. {
  93.     BEGIN_INTERFACE
  94.     MAPI_IUNKNOWN_METHODS(PURE)
  95.     MAPI_ITABLEDATA_METHODS(PURE)
  96. };
  97.  
  98.  
  99. /* Entry Point for in memory ITable */
  100.  
  101.  
  102. /*  CreateTable()
  103.  *      Creates the internal memory structures and object handle
  104.  *      to bring a new table into existence.
  105.  *
  106.  *  lpInterface
  107.  *      Interface ID of the TableData object (IID_IMAPITableData)
  108.  *
  109.  *  lpAllocateBuffer, lpAllocateMore, and lpFreeBuffer
  110.  *      Function addresses are provided by the caller so that
  111.  *      this DLL allocates/frees memory appropriately.
  112.  *  lpvReserved
  113.  *      Reserved.  Should be NULL.
  114.  *  ulTableType
  115.  *      TBLTYPE_DYNAMIC, etc.  Visible to the calling application
  116.  *      as part of the GetStatus return data on its views
  117.  *  ulPropTagIndexColumn
  118.  *      Index column for use when changing the data
  119.  *  lpSPropTagArrayColumns
  120.  *      Column proptags for the minimum set of columns in the table
  121.  *  lppTableData
  122.  *      Address of the pointer which will receive the TableData object
  123.  */
  124.  
  125. STDAPI_(SCODE)
  126. CreateTable( LPCIID                 lpInterface,
  127.              ALLOCATEBUFFER FAR *   lpAllocateBuffer,
  128.              ALLOCATEMORE FAR *     lpAllocateMore,
  129.              FREEBUFFER FAR *       lpFreeBuffer,
  130.              LPVOID                 lpvReserved,
  131.              ULONG                  ulTableType,
  132.              ULONG                  ulPropTagIndexColumn,
  133.              LPSPropTagArray        lpSPropTagArrayColumns,
  134.              LPTABLEDATA FAR *      lppTableData );
  135.  
  136. /*  HrGetView()
  137.  *      This function obtains a new view on the underlying data
  138.  *      which supports the IMAPITable interface.  All rows and columns
  139.  *      of the underlying table data are initially visible
  140.  *  lpSSortOrderSet
  141.  *      if specified, results in the view being sorted
  142.  *  lpfCallerRelease
  143.  *      pointer to a routine to be called when the view is released, or
  144.  *      NULL.
  145.  *  ulCallerData
  146.  *      arbitrary data the caller wants saved with this view and returned in
  147.  *      the Release callback.
  148.  */
  149.  
  150. /*  HrModifyRows()
  151.  *      Add or modify a set of rows in the table data
  152.  *  ulFlags
  153.  *      Must be zero
  154.  *  lpSRowSet
  155.  *      Each row in the row set contains all the properties for one row
  156.  *      in the table.  One of the properties must be the index column.  Any
  157.  *      row in the table with the same value for its index column is
  158.  *      replaced, or if there is no current row with that value the
  159.  *      row is added.
  160.  *      Each row in LPSRowSet MUST have a unique Index column!
  161.  *      If any views are open, the view is updated as well.
  162.  *      The properties do not have to be in the same order as the
  163.  *      columns in the current table
  164.  */
  165.  
  166. /*  HrModifyRow()
  167.  *      Add or modify one row in the table
  168.  *  lpSRow
  169.  *      This row contains all the properties for one row in the table.
  170.  *      One of the properties must be the index column.  Any row in
  171.  *      the table with the same value for its index column is
  172.  *      replaced, or if there is no current row with that value the
  173.  *      row is added
  174.  *      If any views are open, the view is updated as well.
  175.  *      The properties do not have to be in the same order as the
  176.  *      columns in the current table
  177.  */
  178.  
  179. /*  HrDeleteRows()
  180.  *      Delete a row in the table.
  181.  *  ulFlags
  182.  *      TAD_ALL_ROWS - Causes all rows in the table to be deleted
  183.  *                     lpSRowSet is ignored in this case.
  184.  *  lpSRowSet
  185.  *      Each row in the row set contains all the properties for one row
  186.  *      in the table.  One of the properties must be the index column.  Any
  187.  *      row in the table with the same value for its index column is
  188.  *      deleted.
  189.  *      Each row in LPSRowSet MUST have a unique Index column!
  190.  *      If any views are open, the view is updated as well.
  191.  *      The properties do not have to be in the same order as the
  192.  *      columns in the current table
  193.  */
  194. #define TAD_ALL_ROWS    1
  195.  
  196. /*  HrDeleteRow()
  197.  *      Delete a row in the table.
  198.  *  lpSPropValue
  199.  *      This property value specifies the row which has this value
  200.  *      for its index column
  201.  */
  202.  
  203. /*  HrQueryRow()
  204.  *      Returns the values of a specified row in the table
  205.  *  lpSPropValue
  206.  *      This property value specifies the row which has this value
  207.  *      for its index column
  208.  *  lppSRow
  209.  *      Address of where to return a pointer to an SRow
  210.  *  lpuliRow
  211.  *    Address of where to return the row number. This can be NULL
  212.  *    if the row number is not required.
  213.  *
  214.  */
  215.  
  216. /*  HrEnumRow()
  217.  *      Returns the values of a specific (numbered) row in the table
  218.  *  ulRowNumber
  219.  *      Indicates row number 0 to n-1
  220.  *  lppSRow
  221.  *      Address of where to return a